#-*- coding:UTF-8 -*-
'''
Created on 2013-6-4

@author: hanjiewu
'''
#260
#字典的比较
'''
(1)比较字典长度
(2)比较字典的键
(3)比较字典的值
(4) Exact Match
'''
'''
集合的概念：
'''
import copy
dict1 = {}
dict2 = {'name': 'earth', 'port':80}
print dict1, dict2

fdict = dict([(1,2),(3,4)])
print fdict

ddict = {}.fromkeys([1,2,3,4], 5)
print ddict

print dict(name=1, host='hanjie')

print ddict.copy()
print copy.copy(ddict)

print hash(11)

try:
    print hash([])
except TypeError, e:
    print 'error: %s' % e
finally:
    print 'finally'

s = set('abcdefghijklmnopqrstuvwxyz')
s.add(1)
print s

print type(s)
t = frozenset('abcde')
t.add(1)
print type(t)